package util;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;

import java.util.HashMap;
import java.util.Map;

public class WechatMsgTest {
    public static void main(String[] args) {
        String url="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=2c6ac24d-9b6c-45fb-8fbb-63c9e6b3c558";
        Map<String,Object> datas=new HashMap<>();
        datas.put("msgtype","text");
        Map<String,Object> text=new HashMap<>();
        text.put("content","Hello Word");
        text.put("mentioned_mobile_list",new String[]{"18079718061"});
        datas.put("text",text);
        System.out.println(JSONUtil.parse(datas).toString());
        System.out.println(HttpRequest.post(url).body(JSONUtil.parse(datas).toString()).execute().body());;
    }
}
